package teatimeworks.com.algorithm;

import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

public class AlgorithmAppActivity extends Activity {

	private TextView _outputView;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        _outputView = (TextView) findViewById(R.id.textOut);
    }
    

    public void runTest(View view) {
    	EditText text = (EditText) findViewById(R.id.editText);
    	Spinner spinner = (Spinner) findViewById(R.id.spinner1);
    	Object obj =spinner.getSelectedItem();
    	
    	String result = Selector.getResult(obj, text.getText().toString());
    	output(result);
    }
    
    
    private void output(String s){
    	_outputView.setText(s);
    }
}